/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-03-31
 * Time: 17:18
 */
class Student{
    private String name="bite";
    public int age=19;
    public Student(){
        System.out.println("Student()");
    }
    public Student(String name,int age){
        this.name=name;
        this.age=age;
        System.out.println("Student(String,name");
    }
    private void eat(){
        System.out.println(" i am eating");
    }
    public void sleep(){
        System.out.println("i am a pig");
    }
    private void function(String str){
        System.out.println(str);
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
public class Demo1 {
    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        Class c1=null;
        c1=Class.forName("Student");
        /**
         * newInstance(),创建类的实例
         */
        Object object=c1.newInstance();
        Student student=(Student) object;
        System.out.println(student);

    }
}
